<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
	<meta charset="UTF-8" />
	<title></title>

	<link rel="stylesheet" type="text/css" media="screen" href="/webResources/plugins/ztree/zTreeStyle.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="/webResources/plugins/chosen/chosen.css" />
	<link href="/webResources/css/custom/validate.css" rel="stylesheet"/>

	<script type="text/javascript" src="/webResources/plugins/jquery-validate/dist/jquery.validate.min.js" ></script>
	<script type="text/javascript" src="/webResources/plugins/jquery-validate/dist/localization/messages_zh.js" ></script>
	<script type="text/javascript" src="/webResources/plugins/jquery-form/jquery.form.min.js" ></script>
	<script type="text/javascript" src="/webResources/plugins/jquery-BlockUI/jquery.blockUI.js" ></script>
	<script type="text/javascript" src="/webResources/plugins/chosen/chosen.jquery.js" ></script>
	<script type="text/javascript" src="/webResources/plugins/ztree/jquery.ztree.all.min.js"></script>
	<script type="text/javascript" src="/webResources/js/custom/account/save.js" ></script>

</head>

<body class="skin-blue sidebar-mini">
<form class="form-horizontal" role="form" th:object="${account}" id="accountForm">
	<input type="hidden" id="accountId" name="accountId" th:value="${account.id}"/>
	<input type="hidden" id="password" name="password" th:value="${account.password}"/>
	<input type="hidden" id="roleIds" name="roleIds" th:value="${roleIds}"/>
	<input type="hidden" id="groupIds" name="groupIds" th:value="${groupIds}"/>
	<input type="hidden" id="accountstatus" name="accountstatus" th:value="${account.status}"/>
	<fieldset>
		<div class="form-group" th:unless="${account.id!=null}">
			<label class="col-sm-3 control-label"  th:text="#{account.loginId}" for="loginId">账号</label>
			<div class="col-sm-8">
				<input type="text" th:field="*{loginId}" id="loginId" class="form-control" th:placeholder="#{account.loginId}"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label"  th:text="#{account.name}" for="name">用户名</label>
			<div class="col-sm-8">
				<input type="text" th:field="*{name}" id="name" class="form-control" th:placeholder="#{account.name}"/>
			</div>
		</div>
		<div class="form-group" id="showPassword">
			<label class="col-sm-3 control-label"  th:text="#{account.password}" for="newPassword">密码</label>
			<div class="col-sm-8">
				<input type="password" name="newPassword" id="newPassword" class="form-control" th:placeholder="#{account.password}"/>
			</div>
		</div>
		<div class="form-group" id="showPasswordConfirm">
			<label class="col-sm-3 control-label"  th:text="#{account.password.confirm}" for="passwordConfirm">确认密码</label>
			<div class="col-sm-8">
				<input type="password" name="passwordConfirm"  id="passwordConfirm" class="form-control" th:placeholder="#{account.password.confirm}"/>
			</div>
		</div>
		<div class="form-group" id="showPasswordEdit" th:if="${account.id}">
			<label class="col-sm-3 control-label"  th:text="#{account.password}" for="password">密码</label>
			<div class="col-sm-8">
				<input type="button" id="passwordEdit" th:value="#{account.password.edit}" class="btn btn-info"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label"  th:text="#{account.tel}" for="tel">手机号</label>
			<div class="col-sm-8">
				<input type="text" th:field="*{tel}" id="tel" class="form-control" th:placeholder="#{account.tel}"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label"  th:text="#{account.emailAddress}" for="emailAddress">邮箱</label>
			<div class="col-sm-8">
				<input type="text" th:field="*{emailAddress}" id="emailAddress" class="form-control" th:placeholder="#{account.emailAddress}"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label" th:text="#{account.rolegroupdep}">选择角色-组-部门</label>
			<div id="roleSelect" class="col-sm-8">
				<select name="role" id="role" class="form-control" multiple="multiple" style="width: 350px">
					<option th:each="role : ${roles}" th:field="*{roleList}" th:attr="depId=${role.depGroup.department.id}" th:value="${role.id}" th:text="${role.name}+'-'+${role.depGroup.name}+'-'+${role.depGroup.department.name}"></option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label"  th:text="#{account.roleFunctionGroup.choose}">选择权限组</label>
			<div class="col-sm-8">
				<select name="roleFunctionGroup" id="roleFunctionGroup" class="form-control" multiple="multiple" style="width: 350px">
					<option th:each="roleFunctionGroup : ${roleFunctionGroups}" th:field="*{roleFunctionGroupList}" th:value="${roleFunctionGroup.id}" th:text="${roleFunctionGroup.name}"></option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label"  th:text="#{account.roleFunction.choose}">选择权限</label>
			<div class="col-sm-8">
				<div class="zTreeDemoBackground left">
					<ul id="accountRoleFunctionTree" class="ztree"></ul>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label"  th:text="#{account.status}">是否禁用</label>
			<div class="col-sm-3">
				<select id="status" name="status">
					<option value="1" >启用</option>
					<option value="0" >禁用</option>
				</select>
			</div>
		</div>
	</fieldset>
</form>
</body>

</html>
